{{- $version := "0.0.5" }}
{{- $image_version := $version | replace "." "-" }}
---
image: {{ $.ModuleName }}/{{ $.ImageName }}-{{ $image_version }}
from: {{ $.Images.BASE_SCRATCH }}
import:
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
  add: /
  to: /
  includePaths:
  - d8
  - install
  - uninstall
  before: setup
docker:
  LABEL:
    distro: all
    version: all
    d8: {{ $version }}
---
artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
from: {{ $.Images.BASE_GOLANG_22_BULLSEYE_DEV }}
git:
  - add: /{{ $.ModulePath }}modules/007-{{ $.ModuleName }}/images/{{ $.ImageName }}/scripts
    to: /
    stageDependencies:
      setup:
      - '**/*'
shell:
  setup:
  - export GOPROXY={{ $.GOPROXY }}
  - git clone --depth 1 --branch v{{ $version }} {{ $.SOURCE_REPO }}/deckhouse/deckhouse-cli.git
  - cd /deckhouse-cli
  - task build:dist:linux:amd64
  - mv ./dist/v{{ $version }}/linux-amd64/d8 /d8
  - chmod +x /d8 /install /uninstall
